
package gov.chinatax.ctcps.generator.form;

import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for dmHdqrzt.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="dmHdqrztForm"
 */
public class DmHdqrztForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _hdqrztDm = null;
   private java.lang.String _hdqrztMc = null;

   /**
    * Standard constructor.
    */
   public DmHdqrztForm() {
   }

   /**
    * Returns the hdqrztDm
    *
    * @return the hdqrztDm
    */
   public java.lang.String getHdqrztDm() {
      return _hdqrztDm;
   }

   /**
    * Sets the hdqrztDm
    *
    * @param hdqrztDm the new hdqrztDm value
    */
   public void setHdqrztDm(java.lang.String hdqrztDm) {
      _hdqrztDm = hdqrztDm;
   }
   /**
    * Returns the hdqrztMc
    *
    * @return the hdqrztMc
    */
   public java.lang.String getHdqrztMc() {
      return _hdqrztMc;
   }

   /**
    * Sets the hdqrztMc
    *
    * @param hdqrztMc the new hdqrztMc value
    */
   public void setHdqrztMc(java.lang.String hdqrztMc) {
      _hdqrztMc = hdqrztMc;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getHdqrztDm() == null) {
         errors.add("hdqrztDm", new ActionError("error.hdqrztDm.required"));
      }
      if(getHdqrztMc() == null) {
         errors.add("hdqrztMc", new ActionError("error.hdqrztMc.required"));
      }
      // TODO test format/data
      return errors;
   }
}
